package com.xh.hongaiagent.agent;


import com.xh.hongaiagent.agent.model.AgentStatus;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.extern.slf4j.Slf4j;


@EqualsAndHashCode(callSuper = true)
@Slf4j
@Data
public abstract class ReActAgent extends BaseAgent{
    @Override
    public String step() {
        try {
            boolean needAct = think();
            if (!needAct){
                return "思考完成，无需下一步行动！";
            }
            return act();
        } catch (Exception e){
            e.printStackTrace();
            return "步骤执行异常： "+ e.getMessage();
        }

    }

    public abstract boolean think();

    public abstract String act();
}
